home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1989 Special Issue
/
rerun-1989-special-issue.d64
/
clock demo
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
1KB
|
37 lines
100 rem program 2 - tod clock alarm demo
110 rem
120 l(1)=1:l(2)=9:l(4)=5:l(5)=9:l(7)=5:l(8)=9:l(10)=9
130 poke53280,0:poke53281,0:print"[147][158]";
140 ifa=0thenprint"loading alarm.irq":a=1:load"alarm.irq",8,1
150 sys 49152
160 print"[159][147][158]1. set clock time"
170 print"2. set alarm time"
180 print"3. quit"
190 getb$:ifb$<"1"orb$>"3"then190
200 ifb$="1"thencb=0:t$="clock"
210 ifb$="2"thencb=128:t$="alarm"
220 ifb$="3"thenend
230 print"please enter the "t$" time":h=1:ap$="a":m=0:s=0
240 print"01:00:00.0a[157][157][157][157][157][157][157][157][157][157][157]";:tm$="01:00:00.0a":cp=1
250 print""mid$(tm$,cp,1)"[146][157]";
260 geta$:ifa$=""then260
270 ifa$=chr$(13)then380
280 ifa$=""then340
290 ifcp<11then320
300 ifa$<>"a"anda$<>"p"then260
310 gosub330:goto260
320 ifa$<"0"ora$>chr$(l(cp)+48)then260
330 tm$=left$(tm$,cp-1)+a$+right$(tm$,11-cp)
340 printmid$(tm$,cp,1);:cp=cp+1+11*(cp=11)
350 ifcp/3=int(cp/3)thenprint"";:cp=cp+1
360 ifcp=1thenprint"[157][157][157][157][157][157][157][157][157][157][157]";
370 goto250
380 poke56335,cb
390 ap$=right$(tm$,1):h=val(mid$(tm$,1,1))*16+val(mid$(tm$,2,1))
400 m=val(mid$(tm$,4,1))*16+val(mid$(tm$,5,1))
410 s=val(mid$(tm$,7,1))*16+val(mid$(tm$,8,1))
420 hp=-128*(ap$="p")+h:poke56331,hp
430 poke56330,m:poke56329,s:poke56328,val(mid$(tm$,10,1))
440 ifb$="2"thenpoke56333,136
450 goto160